using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace JointEffort_Gallery
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class GameScreen : Screens
    {
        Game g;
        SpriteBatch sb;
        SpriteFont sf;
        HUDElements HUD;

        public GameScreen(Game game)
            : base(game)
        {
            // TODO: Construct any child components here
            g = game;
        }

        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {
            // TODO: Add your initialization code here
           // HUD = new HUDElements(g);
           // HUD.Initialize();
            //base.Initialize();
            g.Components.Add(HUD);
        }

        protected override void LoadContent()
        {
            //base.LoadContent();
        }

        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            // TODO: Add your update code here
            if (this.MainScreenState != ScreenStates.GameScreen)
            {
                g.Components.Remove(HUD);
            }
            
            //base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            //base.Draw(gameTime);
            sb = Game.Services.GetService(typeof(SpriteBatch)) as SpriteBatch;
            sf = Game.Services.GetService(typeof(SpriteFont)) as SpriteFont;
            
            sb.Begin();
            sb.DrawString(sf, "JAPANESE!!!", new Vector2(base.TrueMiddle.X,base.TrueMiddle.Y), Color.White);
            sb.End();
        }
    }
}
